﻿<UserControl x:Class="BrasilFramework.Controle.Silverlight.ListaTroca"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:my="clr-namespace:BrasilFramework.Controle.Silverlight" 
    xmlns:Comum="clr-namespace:BrasilFramework.Controle.Silverlight.Comum"
    xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    mc:Ignorable="d"
    d:DesignHeight="500" d:DesignWidth="700">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="140" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Controls:DockPanel>
            <TextBlock Text="{Binding TituloOrigem}" Controls:DockPanel.Dock="Top" />
            <my:TextBox x:Name="txtOrigem" Controls:DockPanel.Dock="Top" TextChanged="txtOrigem_TextChanged" Margin="0,0,0,3" />
            <my:ListBox x:Name="lstOrigem">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <CheckBox IsChecked="{Binding Selecionado, Mode=TwoWay}"></CheckBox>
                            <TextBlock Text="{Binding Chave}"></TextBlock>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </my:ListBox>
        </Controls:DockPanel>
        <StackPanel Grid.Column="1" VerticalAlignment="Center">
            <StackPanel.Resources>
                <Comum:Mensagem x:Key="RecursoMensagem" />
            </StackPanel.Resources>
            <Button x:Name="btnAdicionar" Margin="0,5,0,0" Content="{Binding Source={StaticResource RecursoMensagem}, Path=Adicionar}" Click="btnAdicionar_Click" Height="24" Width="100"></Button>
            <Button x:Name="btnRemover" Margin="0,5,0,0" Content="{Binding Source={StaticResource RecursoMensagem}, Path=Remover}" Click="btnRemover_Click" Height="24" Width="100"></Button>
            <Button x:Name="btnAdicionarTodos" Margin="0,5,0,0" Content="{Binding Source={StaticResource RecursoMensagem}, Path=AdicionarTodos}" Click="btnAdicionarTodos_Click" Height="24" Width="100"></Button>
            <Button x:Name="btnRemoverTodos" Margin="0,5,0,0" Content="{Binding Source={StaticResource RecursoMensagem}, Path=RemoverTodos}" Click="btnRemoverTodos_Click" Height="24" Width="100"></Button>
        </StackPanel>
        <Controls:DockPanel Grid.Column="2">
            <TextBlock Text="{Binding TituloDestino}" Controls:DockPanel.Dock="Top" />
            <my:TextBox x:Name="txtDestino" Controls:DockPanel.Dock="Top" TextChanged="txtDestino_TextChanged" Margin="0,0,0,3" />
            <my:ListBox x:Name="lstDestino">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <CheckBox IsChecked="{Binding Selecionado, Mode=TwoWay}"></CheckBox>
                            <TextBlock Text="{Binding Chave}"></TextBlock>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </my:ListBox>
        </Controls:DockPanel>
    </Grid>
</UserControl>
